package com.zhangqiang.git.swaggerdemo.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

@Api(value = "desc of class")
@RestController()
@RequestMapping("/device/lock")
public class LockController {


    @ApiOperation(value = "test swagger get")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "username", value = "登陆账号", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "password", value = "密码", required = true, dataType = "String", paramType = "query")
    })
    @GetMapping("/get")
    public String get(String username,String password) {
        return "username:"+username+"  password:"+password;
    }

    @ApiOperation(value = "test swagger post")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "username", value = "登陆账号", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "password", value = "密码", required = true, dataType = "String", paramType = "query")
    })
    @PostMapping("/post")
    public String post(String username,String password) {
        return "username:"+username+"  password:"+password;
    }
}
